package cn.edu.scau.cmi.zhuangzhihong.composite.consistence;

import java.util.List;

public class Leaf implements Component{

	private String name;
	
	public Leaf(String name) {
		this.name=name;
	}
	
public void add(Component c) {
		
		throw new UnsupportedOperationException("对象不支持");
	}
public void remove(int index) {
	throw new UnsupportedOperationException("对象不支持");
}

public List<Component> getchild(){
	throw new UnsupportedOperationException("对象不支持");
}

	@Override
	public StringBuilder printStruct(String Struct) {
		// TODO 自动生成的方法存根
		StringBuilder sd = new StringBuilder();
		sd.append(Struct +"-"+name);
		return sd;
	}
	

}
